/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.ac.iie.di.wx.startup;

import cn.ac.iie.di.wx.common.RuntimeEnv;
import static cn.ac.iie.di.wx.startup.Starter.init;
import cn.ac.iie.di.wx.utils.DateUtil;
import cn.ac.iie.di.wx.utils.RedisUtil;

/**
 *
 * @author Administrator
 */
public class SetRedisValue {

    public static void main(String[] args) throws Exception {
        init();
        String redisHosts = ((String) RuntimeEnv.getParam(RuntimeEnv.REDIS_HOSTS));
        String masterName = (String) RuntimeEnv.getParam(RuntimeEnv.REDIS_MASTER_NAME);
        String dbName = (String) RuntimeEnv.getParam(RuntimeEnv.REDIS_DB_NAME);
        RedisUtil userRedisUtil = new RedisUtil(redisHosts, masterName, Integer.parseInt(dbName));

        String yesterdayDate = DateUtil.getYesterdayDate();
        System.out.println(userRedisUtil.set((String) RuntimeEnv.getParam(RuntimeEnv.DATASIZE) + yesterdayDate, "212121"));//昨天
        System.out.println(userRedisUtil.get((String) RuntimeEnv.getParam(RuntimeEnv.DATASIZE) + yesterdayDate));
        userRedisUtil.set((String) RuntimeEnv.getParam(RuntimeEnv.DATASIZE) + DateUtil.getToDay_Date(), "212121");//今天
        userRedisUtil.set((String) RuntimeEnv.getParam(RuntimeEnv.ALLCOUNT) + yesterdayDate, "111111");
        userRedisUtil.set((String) RuntimeEnv.getParam(RuntimeEnv.SUCCESSCOUNT) + yesterdayDate, "2222222");
    }
}
